package com.shuqing.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @program: ShuqingLibrary
 * @ClassName ServletContainersInitConfig
 * @description:
 * @author: Ats
 * @create: 2025-03-31 09:27
 * @Version 1.0
 */
public class ServletContainersInitConfig extends AbstractAnnotationConfigDispatcherServletInitializer {
    /**
     加载Spring配置类中的信息，
     初始化Spring容器
     */
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{SpringConfig.class};
    }

    /**
     * 初始化SpringMVC配置
     * @return
     */

    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{SpringMvcConfig.class};
    }

    //配置DispatcherServlet的映射路径
    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
